/*
//------------------------假接口API和方法//
//统一管理项目用户相关接口
import request from '@/utils/request'
import type { loginFormData, loginResponseData, userInfoResponseData } from './type'

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
  LOGOUT_URL = '/user/logout'
}

//登录接口方法
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)
//获取用户信息接口方法
export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USERINFO_URL)
//退出登录接口方法
export const reqLogout = () =>
  request.post<any, any>(API.LOGOUT_URL)
*/

//统一管理项目用户相关接口
import request from '@/utils/request'
import type {
    registerFormData,
    loginFormData,
    responseData,
    loginResponseData,
    editAvatarFormData,
    editAvatarResponseData,
} from './type'

//请求接口API
enum API {
    //注册
    REGISTER_URL = '/user/register',
    //登录
    LOGIN_URL = '/user/login',
    //退出登录
    LOGOUT_URL = '/user/logout',
    //更换头像
    EDITAVATAR_URL = '/user/edit-avatar',
}

//注册接口方法
export const reqRegister = (data: registerFormData) =>
    request.post<any, responseData>(API.REGISTER_URL, data)
//登录接口方法
export const reqLogin = (data: loginFormData) =>
    request.post<any, loginResponseData>(API.LOGIN_URL, data)
//退出登录接口方法
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
//更换头像接口方法
export const reqEditAvatar = (data: editAvatarFormData) =>
    request.post<any, editAvatarResponseData>(API.EDITAVATAR_URL, data)
